package com.qyer.search.storm.util;

import java.io.Serializable;

/**
 * Created by tangzheng on 16/1/10.
 */
public class City implements Serializable {
  private int id;
  private String city;

  public City() {
  }

  public City(int id, String city){
    this.id = id;
    this.city = city;
  }
  public String getCity() {
    return city;
  }

  public void setCity(String city) {
    this.city = city;
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  @Override public String toString() {
    return "City{" +
      "id=" + id +
      ", city='" + city + '\'' +
      '}';
  }

  @Override public boolean equals(Object o) {
    if (this == o)
      return true;
    if (o == null || getClass() != o.getClass())
      return false;

    City city1 = (City) o;

    if (id != city1.id)
      return false;
    return !(city != null ? !city.equals(city1.city) : city1.city != null);

  }

  @Override public int hashCode() {
    int result = id;
    result = 31 * result + (city != null ? city.hashCode() : 0);
    return result;
  }
}
